﻿using Project.API.Models;
using Project.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Project.API.Controllers
{
    public class ImagesController : ApiController
    {
        // GET: api/Images
        public ResultData<List<ImagesDto>> Get()
        {
            int count = 0;
            var list = new ImagesBll().Query();

            var data = from i in list
                       select new ImagesDto
                       {
                           ImgId = i.ImgId,
                           Title = i.Title,
                           Path = i.Path,
                           Size = i.Size,
                           Extension = i.Extension,
                           Modular = i.Modular,
                           LastTime = i.LastTime,
                       };


            ResultData<List<ImagesDto>> result = new ResultData<List<ImagesDto>>();
            result.code = 0;
            result.msg = "ok";
            result.data = data.ToList();

            return result;
        }

        // GET: api/Images/5
        public string Get(int id)
        {
            return "value";
        }

        // POST: api/Images
        public void Post([FromBody]string value)
        {
        }

        // PUT: api/Images/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE: api/Images/5
        public void Delete(int id)
        {
        }
    }
}
